package csc.daonjpa.java.dao;

import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import csc.daonjpa.java.domain.CustomerRole;

@Service
public class CustomerRoleDAOImpl implements CustomerRoleDAO {

	@PersistenceContext
	private EntityManager entityManager;
	
	@Transactional
	public boolean addCustomerRole(CustomerRole customerRole) {
		try {
			entityManager.persist(customerRole);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
			return false;
		}
		return true;
	}

}
